package com.jc.ds.model;

/**
 * attribute_value
 * @author 
 */
public class AttributeValue extends BaseValueObject {
    private Long id;

    /**
     * 所属属性名称ID
     */
    private Long attributeNameId;

    /**
     * 所属属性名称
     */
    private String attributeName;

    /**
     * 属性值
     */
    private String attributeValue;

    /**
     * 扩展字段
     */
    private String extend1;

    /**
     * 扩展字段
     */
    private String extend2;

    /**
     * 扩展字段
     */
    private String extend3;

    /**
     * 扩展字段
     */
    private String extend4;

    /**
     * 扩展字段
     */
    private String extend5;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getAttributeNameId() {
        return attributeNameId;
    }

    public void setAttributeNameId(Long attributeNameId) {
        this.attributeNameId = attributeNameId;
    }

    public String getAttributeName() {
        return attributeName;
    }

    public void setAttributeName(String attributeName) {
        this.attributeName = attributeName;
    }

    public String getAttributeValue() {
        return attributeValue;
    }

    public void setAttributeValue(String attributeValue) {
        this.attributeValue = attributeValue;
    }

    public String getExtend1() {
        return extend1;
    }

    public void setExtend1(String extend1) {
        this.extend1 = extend1;
    }

    public String getExtend2() {
        return extend2;
    }

    public void setExtend2(String extend2) {
        this.extend2 = extend2;
    }

    public String getExtend3() {
        return extend3;
    }

    public void setExtend3(String extend3) {
        this.extend3 = extend3;
    }

    public String getExtend4() {
        return extend4;
    }

    public void setExtend4(String extend4) {
        this.extend4 = extend4;
    }

    public String getExtend5() {
        return extend5;
    }

    public void setExtend5(String extend5) {
        this.extend5 = extend5;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByAttributeNameId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by attribute_name_id asc";
            }else{
                this.orderStr = this.orderStr + ",attribute_name_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by attribute_name_id desc";
            }else{
                this.orderStr = this.orderStr + ",attribute_name_id desc";
            }
        }
    }

    public void orderByAttributeName(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by attribute_name asc";
            }else{
                this.orderStr = this.orderStr + ",attribute_name asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by attribute_name desc";
            }else{
                this.orderStr = this.orderStr + ",attribute_name desc";
            }
        }
    }

    public void orderByAttributeValue(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by attribute_value asc";
            }else{
                this.orderStr = this.orderStr + ",attribute_value asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by attribute_value desc";
            }else{
                this.orderStr = this.orderStr + ",attribute_value desc";
            }
        }
    }

    public void orderByExtend1(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend1 asc";
            }else{
                this.orderStr = this.orderStr + ",extend1 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend1 desc";
            }else{
                this.orderStr = this.orderStr + ",extend1 desc";
            }
        }
    }

    public void orderByExtend2(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend2 asc";
            }else{
                this.orderStr = this.orderStr + ",extend2 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend2 desc";
            }else{
                this.orderStr = this.orderStr + ",extend2 desc";
            }
        }
    }

    public void orderByExtend3(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend3 asc";
            }else{
                this.orderStr = this.orderStr + ",extend3 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend3 desc";
            }else{
                this.orderStr = this.orderStr + ",extend3 desc";
            }
        }
    }

    public void orderByExtend4(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend4 asc";
            }else{
                this.orderStr = this.orderStr + ",extend4 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend4 desc";
            }else{
                this.orderStr = this.orderStr + ",extend4 desc";
            }
        }
    }

    public void orderByExtend5(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend5 asc";
            }else{
                this.orderStr = this.orderStr + ",extend5 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend5 desc";
            }else{
                this.orderStr = this.orderStr + ",extend5 desc";
            }
        }
    }
}